<%--
  Created by IntelliJ IDEA.
  User: lainiao
  Date: 2021/4/21
  Time: 20:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>测试Session作用域</title>
</head>
<body>
    <h2>测试Session作用域</h2>

    <%
        // 获取 session
        String user1 = (String) request.getSession().getAttribute("user1");
        String user2 = (String) request.getSession().getAttribute("user2");
        String password = (String) request.getSession().getAttribute("password");
        // 获取 request
        String Do = (String) request.getAttribute("do");

        // 输出
        System.out.println(
                "user1：" + user1 + "\n" +
                "user2：" + user2 + "\n" +
                "password：" + password + "\n" +
                "do：" + Do);
    %>


</body>
</html>
